package com.infosys.newSimpleInvertedIndex.entities;

import java.io.Serializable;
import java.util.UUID;

import com.baomidou.mybatisplus.annotation.TableField;
import com.infosys.newSimpleInvertedIndex.dto.RelativeDTOI;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 员工关系表
 * </p>
 *
 * @author Tester
 * @since 2024-06-24
 */
@Getter
@Setter
@Data
public class Relative implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;
    @TableField("employee_id")
    private String employeeId;

    private String name;

    private String jobTitle;

    private String politicalTitle;

    private String type;

    public Relative() {
        this.id = UUID.randomUUID().toString();
    }

    public Relative(RelativeDTOI relativeDTOI){
        this.id = UUID.randomUUID().toString();
        this.employeeId = relativeDTOI.getEmployeeId();
        this.name = relativeDTOI.getName();
        this.jobTitle = relativeDTOI.getJobTitle();
        this.politicalTitle = relativeDTOI.getPoliticalTitle();
        this.type = relativeDTOI.getType();
    }

    public Relative(String id, RelativeDTOI relativeDTOI){
        this.id = id;
        this.employeeId = relativeDTOI.getEmployeeId();
        this.name = relativeDTOI.getName();
        this.jobTitle = relativeDTOI.getJobTitle();
        this.politicalTitle = relativeDTOI.getPoliticalTitle();
        this.type = relativeDTOI.getType();
    }

}
